//bange_layerobject.hpp
//Copyright (C) 2010-2011 Oscar (.teri) Triano

//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.

//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.

//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

#ifndef _bange_layerobject_
#define _bange_layerobject_

#include <list>
#include <SFML/Graphics.hpp>
#include <chipmunk/chipmunk.h>
#include <lua5.1/lua.hpp>
#include <bange_layer.hpp>
#include <bange_object.hpp>

namespace bange{
	
	class layerobject: public bange::layer{
		private:
			list<bange::object *> objects;
		public:
			layerobject(cpSpace *, lua_State *);
			bool Index(lua_State *);
			void ManageEvent(int, int, sf::Event &, lua_State *);
			void Process(int, float, lua_State *);
			void Draw(sf::RenderWindow *, sf::View &);
			void AddObject(bange::object *);
			void CleanVM(lua_State *);
			~layerobject();
			static void RegisterVM(lua_State *);
		
	};

}

static int bangelayerobject_AddSimpleString(lua_State *);
static int bangelayerobject_AddSimpleSprite(lua_State *);
static int bangelayerobject_AddSprite(lua_State *);

#endif
